package com.hgyc.mom.tool.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.hgyc.mom.common.annotation.Excel;
import com.hgyc.mom.core.mybatis.Like;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 定时任务调度
 * </p>
 *
 * @author fwj
 * @since 2025-05-08
 */
@Data
@TableName("tool_job")
@Schema(name="定时任务调度对象", description="定时任务调度对象")
public class Job implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "任务ID")
    private Long id;

    @Excel(name = "任务名称")
    @Like
    @Schema(description = "任务名称")
    private String jobName;

    @Excel(name = "任务组名")
    @Like
    @Schema(description = "任务组名")
    private String jobGroup;

    @Excel(name = "调用目标字符串")
    @Schema(description = "调用目标字符串")
    private String invokeTarget;

    @Excel(name = "cron执行表达式")
    @Schema(description = "cron执行表达式")
    private String cronExpression;

    @Excel(name = "计划执行错误策略", readConverterExp = "1=立即执行,2=执行一次,3=放弃执行")
    @Schema(description = "计划执行错误策略（1立即执行 2执行一次 3放弃执行）")
    private String misfirePolicy;

    @Excel(name = "是否并发执行", readConverterExp = "0=允许,1=禁止")
    @Schema(description = "是否并发执行（0允许 1禁止）")
    private String concurrent;

    @Excel(name = "状态", readConverterExp = "0=正常,1=暂停")
    @Schema(description = "状态（0正常 1暂停）")
    private String status;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建者")
    private Long createBy;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(description = "更新者")
    private Long updateBy;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    @Excel(name = "备注信息")
    @Schema(description = "备注信息")
    private String remark;

}